$(function () {

//消息中心

    //首页消息框数值(实时监听消息中心ul中li数量,最多显示99条)
    function getmsg() {
        var msggg = $('#messagecenter article ul').children().length;
        if (msggg > 99) {
            msggg = 99;
        }
        if (msggg !== 0) {
            $('#homepage header span').css("display", "block");
        } else if (msggg === 0) {
            $('#homepage header span').css("display", "none");
        }
        $('#homepage header span').text(msggg);
    }
    //(首次刷新)+(定时刷新)
    getmsg();
    window.setInterval(getmsg, 1000);



    //点赞功能
    $('.message_msg button').click(function () {
        $(this).css({"background": "url(img/homepage/like.png) no-repeat", "background-size": ".34rem .28rem", "background-position-y": ".125rem"});    //改图片
        $(this).attr("disabled", "disabled");   //不可再点击
        var num = $(this).text();
        $(this).text(parseInt(num) + 1);    //增加次数

//        ajax

    });







});